package com.org.model;

/**
 * ProductTagId entity. @author MyEclipse Persistence Tools
 */

public class ProductTagId implements java.io.Serializable {

	// Fields

	private Product product;
	private Tag tag;

	// Constructors

	/** default constructor */
	public ProductTagId() {
	}

	/** full constructor */
	public ProductTagId(Product product, Tag tag) {
		this.product = product;
		this.tag = tag;
	}

	// Property accessors

	public Product getProduct() {
		return this.product;
	}

	public void setProduct(Product product) {
		this.product = product;
	}

	public Tag getTag() {
		return this.tag;
	}

	public void setTag(Tag tag) {
		this.tag = tag;
	}

	public boolean equals(Object other) {
		if ((this == other))
			return true;
		if ((other == null))
			return false;
		if (!(other instanceof ProductTagId))
			return false;
		ProductTagId castOther = (ProductTagId) other;

		return ((this.getProduct() == castOther.getProduct()) || (this
				.getProduct() != null
				&& castOther.getProduct() != null && this.getProduct().equals(
				castOther.getProduct())))
				&& ((this.getTag() == castOther.getTag()) || (this.getTag() != null
						&& castOther.getTag() != null && this.getTag().equals(
						castOther.getTag())));
	}

	public int hashCode() {
		int result = 17;

		result = 37 * result
				+ (getProduct() == null ? 0 : this.getProduct().hashCode());
		result = 37 * result
				+ (getTag() == null ? 0 : this.getTag().hashCode());
		return result;
	}

}